from datetime import datetime


def make_response_success(data):
    return {"code": 200, "data": data}


def make_response_failed(data):
    return {"code": 200, "data": data}


def decode(hash_id):
    from app import my_hash

    return my_hash.decode(hash_id)[0]


def format_time(_time: datetime):
    return _time.strftime("%Y-%m-%d %H:%M:%S")
